<?php


  class YongjinAction extends Action{
  
  
    public function fan($orderno){
	
	  
	  $arr['time']=123;
	  
	  M('test')->add($arr);
	  
	  $order=M('buyer')->where('orderno="%s"',$orderno)->find();
	  
	  //dump($order);
	  
	  $user=M('dailiuser')->where('id="%s"',$order['uid'])->find();
	  
	 // dump($user);
	  
	  //查询佣金
	  
	  $yongjin=M('yongjin')->where('id=1')->find();
	  
	  
	  //增加打赏金额
	  
	  $dashang['money']=$user['money']+$order['money'];
	  
	 // dump($dashang);
	  
	  M('dailiuser')->where('id="%s"',$order['uid'])->save($dashang);
	  
	  
	  //向上级返佣
	  
	  
	
	  //第一层返佣结束
	  
	  
	
	
	
	}
  
  
  }